home *** CD-ROM | disk | FTP | other *** search
- option base 1
- defint a-z
- '************************************************
- getparm: 'get command line
- '************************************************
-
- ansi$=chr$(27)+"[32;40;1m" 'color code for .gbs file.
- cm$=command$
- beep$="NO"
- path$=""
- pass$=""
- while right$(cm$,1)=" "
- t$=cm$
- t=len(cm$)-1
- cm$=left$(t$,t)
- wend
- cm$=cm$+" "
- if cm$=" " goto noinfo
- dim cc$(30)
- ccount=1
- ref=1
-
- while not 0=instr(ref,cm$,"-C") '-C display
- cc=1
- cm=instr(ref,cm$,"-C")
- z=instr(cm,cm$," ")
- tmpc$=mid$(cm$,cm+2,z)
- z=instr(tmpc$," ")
- if not z=0 then cc$(ccount)=mid$(tmpc$,1,z-1) else cc$(ccount)=tmpc$
- ccount=ccount+1
- ref=cm+z
- wend
- cm=instr(cm$,"-B") '-B Beep
- if not cm=0 then
- beep$="YES"
- end if
- '-L lastuser display
- CM=INSTR(CM$,"-L")
- if not cm=0 then
- l=1
- end if
-
- CM=INSTR(CM$,"-P") '-P Path
- if not cm=0 then
- z=instr(cm+2,cm$,chr$(32))
- pathtmp$=mid$(cm$,cm+2,z-3)
- Z=INSTR(PATHTMP$," ")
- if not z=0 then path$=mid$(pathtmp$,1,z-1) else path$=pathtmp$
- IF NOT RIGHT$(PATH$,1)="\" THEN PATH$=PATH$+"\"
- end if
-
- CM=INSTR(CM$,"-O") '-O User ok - Pass
- if not cm=0 then
- z=instr(cm+2,cm$,chr$(32))
- passtmp$=mid$(cm$,cm+2,z-3)
- Z=INSTR(PASSTMP$," ")
- if not z=0 then o$=mid$(passtmp$,1,z-1) else o$=passtmp$
- end if
-
- cmtmp$=cm$+"-"
- cm=instr(cmtmp$,"-S") '-S Sysops name
- if not cm=0 then
- z=instr(cm+2,cmtmp$," -")
- z1=instr(cm+2,cmtmp$," ")
- if not z=0 then
- sysop$=mid$(cmtmp$,cm+2,z)
- end if
- z=instr(sysop$,"-")
- if not z=0 then sysop$=left$(sysop$,z-1)
- while right$(sysop$,1)=" "
- sysop$=left$(sysop$,len(sysop$)-1)
- wend
- end if
-
- cm=instr(cm$,"-D") '-D DTR drop
- if not cm=0 then
- z=instr(cm+2,cm$,chr$(32))
- dtr$=mid$(cm$,cm+2,z-3)
- dtr$=left$(dtr$,1)
- select case dtr$
- case "1","2"
- case else
- print"ERROR: Can only specify com port 1 or 2 for DTR drop."
- dtr$=""
- end select
- end if
-
-
- '*****************************************************************************
- find.names: 'Find & organize current & previous users names.
- '*****************************************************************************
- on error goto handler
- call exist("\opus\lastuser.bbs"+chr$(0),filexists)
- if filexists then
- open "r",1,"\opus\lastuser.bbs",72
- field 1,36 as fulln$,_
- 36 as s$
- get 1
- n$=fulln$
- current.state$=s$
- close 1
- while right$(n$,1)=chr$(0)
- n$=left$(n$,len(n$)-1)
- wend
- lcase.fulln$=n$
- call upcase(n$)
- z=instr(n$," ")
- if not z=0 then
- fstn$=left$(n$,z-1)
- lstn$=right$(n$,len(n$)-z)
- elseif z=0 then
- fstn$=n$
- end if
- while right$(current.state$,1)=chr$(0)
- current.state$=left$(current.state$,len(current.state$)-1)
- wend
- else
- print"Can't find "+chr$(34)+"\opus\lastuser.bbs"+chr$(34)+"."
- print"Please see the documentation."
- system
- end if
-
- '*****************************************************************************
- search: 'Search "BADUSER.DAT" for matching names.
- '*****************************************************************************
- color 2,0:print"Checking user name... ";:color 15,0:print lcase.fulln$
- open "i",1,path$+"baduser.dat"
-
- while not eof(1)
- input #1,bad$
- call upcase(bad$)
- if fstn$=bad$ or lstn$=bad$ or n$=bad$ goto baduser
- wend
-
-
- '*****************************************************************************
- gooduser: 'Ok, I *guess* we'll let you through.
- '*****************************************************************************
- close 1
- if l=1 then
- open "r",1,path$+"lastuser.dat",72
- field 1,36 as tmp$,_
- 36 as s$
- get 1,1
- while right$(tmp$,1)=chr$(0) or right$(tmp$,1)=" "
- tmp$=left$(tmp$,len(tmp$)-1)
- wend
- lastuser$=tmp$
- while right$(s$,1)=chr$(0) or right$(s$,1)=" "
- s$=left$(s$,len(s$)-1)
- wend
- lastuser.state$=s$
- gosub clean.state
- close 1
- if not n$=sysop$ then
- open "r",1,path$+"lastuser.dat",72
- field 1,36 as tmp$,_
- 36 as s$
- lset tmp$=lcase.fulln$
- lset s$=current.state$
- put 1,1
- close 1
- end if
- end if
- open "o",1,path$+"baduser.bbs"
- open "o",2,path$+"baduser.gbs"
- print #1,chr$(2)
- print #2,chr$(2)
-
- if cc=1 then
- for x=1 to ccount
- print #1,cc$(x)
- print #2,ansi$+cc$(x)
- next x
- end if
-
- if l=1 then
- gosub greeting
- print #1,greet$+chr$(6)+chr$(6)+"."
- print #2,ansi$+greet$+chr$(6)+chr$(6)+"."
- if not lastuser.state$="" then
- if not left$(lastuser$,1)=chr$(26) then
- print #1,lastuser$+" from "+lastuser.state$+" was the previous caller."
- print #2,ansi$+lastuser$+" from "+lastuser.state$+" was the previous caller."
- end if
- end if
- end if
- print #1,chr$(15)+"F"+o$
- print #2,chr$(15)+"F"+o$
-
- close
- system
-
- '*****************************************************************************
- baduser: 'Go ahead, make my day!
- '*****************************************************************************
- close 1
- if beep$="YES" then
- for z=1 to 6
- for i=440 to 1000 STEP 3.0
- sound i,i/20000
- next i
- for i=1000 to 440 step 3.0
- sound i, i/20000
- next i
- if z=3 then
- color 28,0
- print"Invalid name. Ejecting... ";:color 15,0:print lcase.fulln$
- end if
- next z
- else
- color 28,0
- print"Invalid name. Ejecting... ";:color 15,0:print lcase.fulln$
- end if
- if not dtr$="" then 'This is easier than generating
- if dtr$="1" then dtrval=1 'an interrupt with the fossil.
- if dtr$="2" then dtrval=2
- call dtr(dtrval,0)
- call delay(1)
- call dtr(dtrval,1)
- end if
- open "o",1,path$+"baduser.bbs"
- open "o",2,path$+"baduser.gbs"
- print #1,chr$(2)
- print #2,chr$(2)
- for x=1 to 5:print #1,chr$(7);:next x
- for x=1 to 5:print #2,chr$(7);:next x
- print #1,"Access Denied!";
- print #1,
- print #1,chr$(6)+chr$(14)
- print #2,chr$(27)+"[31;40;5mAccess Denied!";
- print #2,
- print #2,chr$(6)+chr$(14)
- close
- system
-
- '-----------------------------------------------------------------------------
- Clean.state: 'Clean-up that awful formatting <grin>
- '-----------------------------------------------------------------------------
- if lastuser.state$="" then return
- tmp.state$=lastuser.state$
- z=instr(tmp.state$,",")
- if not mid$(tmp.state$,z+1,1)=" " then
- tmp.state$=left$(tmp.state$,z)+" "+mid$(tmp.state$,z+1,len(tmp.state$)-z)
- lastuser.state$=tmp.state$
- end if
- z=instr(tmp.state$,", ")
- if not z=0 then
- if len(mid$(tmp.state$,z+2,len(tmp.state$)-(z-4))) => 3 then
- z1$=left$(tmp.state$,1)
- z2$=mid$(tmp.state$,z+2,1)
- call upcase(z1$)
- call upcase(z2$)
- tmp.state$=z1$+mid$(tmp.state$,2,z)+z2$+mid$(tmp.state$,z+3,len(tmp.state$)-(z-4))
- lastuser.state$=tmp.state$
- else
- z1$=left$(tmp.state$,1)
- z2$=mid$(tmp.state$,z+2,2)
- call upcase(z1$)
- call upcase(z2$)
- tmp.state$=z1$+mid$(tmp.state$,2,z)+z2$
- lastuser.state$=tmp.state$
- end if
- elseif z=0 then
- while left$(tmp.state$,1)=chr$(0) or left$(tmp.state$,1)=" "
- tmp.state$=right$(tmp.state$,len(tmp.state$)-1)
- wend
- x=1
- z1$=left$(tmp.state$,1)
- call upcase(z1$)
- tmp.state$=z1$+mid$(tmp.state$,2,len(tmp.state$)-1)
- do
- z=instr(x,tmp.state$," ")
- if not z=0 then
- z1$=mid$(tmp.state$,z+1,1)
- call upcase(z1$)
- tmp.state$=left$(tmp.state$,z)+z1$+mid$(tmp.state$,z+2,len(tmp.state$)-(z-2))
- x=z+1
- end if
- lastuser.state$=tmp.state$
- loop until z=0
- end if
- return
-
- '-----------------------------------------------------------------------------
- Greeting: 'Why thankyou Gilligan!
- '-----------------------------------------------------------------------------
-
- IF TIME$ <= "11:59:59" THEN
- GREET$="Good morning "
- return
- end if
- IF TIME$ <= "17:59:59" THEN
- GREET$="Good afternoon "
- return
- end if
- GREET$="Good evening "
- return
-
-
- '******************************************************************************
- handler: 'The error handler.
- '******************************************************************************
- PRINT"Can't find Path "+PATH$
- close
- system
-
- '******************************************************************************
- noinfo: 'No parameters from the command line comes here.
- '******************************************************************************
- PRINT" BADUSER v1.20
- PRINT" Copyright(c) 1987 by Greg Dawson
- PRINT" ShutterBUG (106/111) (713)880-4329
- PRINT" ----------------------------------------------------------
- PRINT" Usage...
- PRINT" ----------------------------------------------------------
- PRINT" BADUSER -b -o -p -c -l -d -s
- print
- PRINT" -b <== Turns on the alarm.
- PRINT" -o <== Path and file to display if the user is Ok.
- PRINT" -p <== Path to the BADUSER support files.
- PRINT" -c <== Control character(s) to display if user Ok.
- PRINT" -l <== Enable last user display.
- print" -d1 <== Lower/Raise DTR to drop user (Port 1 or 2).
- print" -s <== Sysops name.
- print
- PRINT" A typical command line might go as follows...
- print
- PRINT" BADUSER -d1 -b -l -sGreg Dawson -oC:\opus\misc\welcome2 -pC:\opus\ -c"+CHR$(1)
- system
-
-
-